/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mobiubiq.directory.client.object.io;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.mobiubiq.directory.client.object.AbstractObject;
import org.mobiubiq.directory.client.object.TagObject;

/**
 *
 * @author Marnix Renne
 */
public class TagObjectReaderWriter implements ObjectReaderWriter{

    public void write(AbstractObject object, DataOutputStream outputStream) throws IOException {
        TagObject to = (TagObject) object;
        outputStream.writeUTF(to.getTag());
    }

    public AbstractObject read(DataInputStream inputStream) throws IOException {
        TagObject result = new TagObject();
        result.setTag(inputStream.readUTF());
        return result;
    }
}
